import { t } from '@/i18n';

export const connectTypeList = [
  {
    label: 'modbus',
    value: 'modbus',
  },
  {
    label: 'fins',
    value: 'fins',
  },
  {
    label: 's7',
    value: 's7',
  },
  {
    label: 'opcua',
    value: 'opcua',
  },
];

export const connectionTypeList = [
  {
    label: 'Serial Port',
    value: 'Serial Port',
  },
  {
    label: 'Modbus TCP/IP',
    value: 'Modbus TCP/IP',
  },
  {
    label: 'Modbus UDP/IP',
    value: 'Modbus UDP/IP',
  },
  {
    label: 'Modbus RTU Over TCP/IP',
    value: 'Modbus RTU Over TCP/IP',
  },
  {
    label: 'Modbus RTU Over UDP/IP',
    value: 'Modbus RTU Over UDP/IP',
  },
];

export const baudRateList = [
  {
    label: '300 Baud',
    value: 300,
  },
  {
    label: '600 Baud',
    value: 600,
  },
  {
    label: '1200 Baud',
    value: 1200,
  },
  {
    label: '2400 Baud',
    value: 2400,
  },
  {
    label: '4800 Baud',
    value: 4800,
  },
  {
    label: '9600 Baud',
    value: 9600,
  },
  {
    label: '14400 Baud',
    value: 14400,
  },
  {
    label: '19200 Baud',
    value: 19200,
  },
  {
    label: '38400 Baud',
    value: 38400,
  },
  {
    label: '56000 Baud',
    value: 56000,
  },
  {
    label: '57600 Baud',
    value: 57600,
  },
  {
    label: '115200 Baud',
    value: 115200,
  },
  {
    label: '128000 Baud',
    value: 128000,
  },
  {
    label: '153600 Baud',
    value: 153600,
  },
  {
    label: '230400 Baud',
    value: 230400,
  },
  {
    label: '2560000 Baud',
    value: 2560000,
  },
  {
    label: '460800 Baud',
    value: 460800,
  },
  {
    label: '921600 Baud',
    value: 921600,
  },
];

export const dataBitsList = [
  {
    label: '7 Data bits',
    value: 7,
  },
  {
    label: '8 Data bits',
    value: 8,
  },
];

export const protocolList = [
  {
    label: 'tcp',
    value: 'tcp',
  },
  {
    label: 'udp',
    value: 'udp',
  },
];

export const autoOpenList = [
  {
    label: '是',
    value: 1,
  },
  {
    label: '否',
    value: 0,
  },
];

export const stopBitsList = [
  {
    label: '1 Stop Bit',
    value: 1,
  },
  {
    label: '2 Stop Bit',
    value: 2,
  },
];

export const parityList = [
  {
    label: 'None Parity',
    value: 'none',
  },
  {
    label: 'Old Parity',
    value: 'old',
  },
  {
    label: 'Even Parity',
    value: 'even',
  },
];

export const modbusDataTypeList = [
  {
    label: 'bool',
    value: 'bool',
  },
  {
    label: 'int16',
    value: 'int16',
  },
  {
    label: 'uint16',
    value: 'uint16',
  },
  {
    label: 'enum',
    value: 'enum',
  },
  {
    label: 'int32',
    value: 'int32',
  },
  {
    label: 'uint32',
    value: 'uint32',
  },
  {
    label: 'float',
    value: 'float',
  },
  {
    label: 'real',
    value: 'real',
  },
  {
    label: 'int64',
    value: 'int64',
  },
  {
    label: 'uint64',
    value: 'uint64',
  },
  {
    label: 'double',
    value: 'double',
  },
  {
    label: 'text',
    value: 'text',
  },
  {
    label: 'bit',
    value: 'bit',
  },
  {
    label: 'bitOne',
    value: 'bitOne',
  },
];

export const byteOrderList = [
  {
    label: '无',
    value: 'none',
  },
  {
    label: 'ABCD',
    value: 'ABCD',
  },
  {
    label: 'CDAB',
    value: 'CDAB',
  },
  {
    label: 'BADC',
    value: 'BADC',
  },
  {
    label: 'DCBA',
    value: 'DCBA',
  },
  {
    label: 'ABCDEFGH',
    value: 'ABCDEFGH',
  },
  {
    label: 'GHEFCDAB',
    value: 'GHEFCDAB',
  },
  {
    label: 'BADCFEHG',
    value: 'BADCFEHG',
  },
  {
    label: 'HGFEDCBA',
    value: 'HGFEDCBA',
  },
];

export const opcuaTypeList = [
  {
    label: 'null',
    value: 'null',
  },
  {
    label: 'Boolean',
    value: 'Boolean',
  },
  {
    label: 'SByte',
    value: 'SByte',
  },
  {
    label: 'Byte',
    value: 'Byte',
  },
  {
    label: 'Int16',
    value: 'Int16',
  },
  {
    label: 'UInt16',
    value: 'UInt16',
  },
  {
    label: 'Int32',
    value: 'Int32',
  },
  {
    label: 'UInt32',
    value: 'UInt32',
  },
  {
    label: 'Int64',
    value: 'Int64',
  },
  {
    label: 'UInt64',
    value: 'UInt64',
  },
  {
    label: 'Float',
    value: 'Float',
  },
  {
    label: 'Double',
    value: 'Double',
  },
  {
    label: 'String',
    value: 'String',
  },
  {
    label: 'DateTime',
    value: 'DateTime',
  },
  {
    label: 'Guid',
    value: 'Guid',
  },
  {
    label: 'ByteString',
    value: 'ByteString',
  },
  {
    label: 'XmlElement',
    value: 'XmlElement',
  },
  {
    label: 'NodeId',
    value: 'NodeId',
  },
  {
    label: 'ExpandedNodeId',
    value: 'ExpandedNodeId',
  },
  {
    label: 'StatusCode',
    value: 'StatusCode',
  },
  {
    label: 'QualifiedName',
    value: 'QualifiedName',
  },
  {
    label: 'LocalizedText',
    value: 'LocalizedText',
  },
  {
    label: 'ExtensionObject',
    value: 'ExtensionObject',
  },
  {
    label: 'DataValue',
    value: 'DataValue',
  },
  {
    label: 'Variant',
    value: 'Variant',
  },
  {
    label: 'DiagnosticInfo',
    value: 'DiagnosticInfo',
  },
];

export const computedTypeList = [
  {
    label: t('common.button.none'),
    value: 'none',
  },
  {
    label: t('common.button.plus'),
    value: 'plus',
  },
  {
    label: t('common.button.reduce'),
    value: 'reduce',
  },
  {
    label: t('common.button.ride'),
    value: 'ride',
  },
  {
    label: t('common.button.except'),
    value: 'except',
  },
];

export const isOpenMultiLineList = [
  {
    label: t('common.button.yes'),
    value: 1,
  },
  {
    label: t('common.button.no'),
    value: 0,
  },
];
